-- clear_timer
--
local import = import
---@type behavior_ret
local bret = import('bt/bt_plugin/behavior3/behavior_ret')
---@type WAIT_TIMER_TYPE
local WAIT_TIMER_TYPE = import('bt/custom_node/enum_type_cfg/WAIT_TIMER_TYPE')
local M = {
    name = "clear_timer",
    type = "Action",
    desc = "清理计时器",
    args = {
        {
            name = 'name',
            type = 'enum?',
            desc = '计时器类型',
            options = WAIT_TIMER_TYPE
        },
    },
    input = { "计时器类型?" },
}

function M.run(node, env, value)
    local name = node.args.name
    local owner = env.owner
    if value then
        name = value
    end
    owner.nodeTimers[name] = nil
    return bret.SUCCESS
end

return M
